package cn.cdeden.knowledge.domain;

import cn.cdeden.knowledge.service.dto.EnterpriseMaterialFilesTreeDto;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
* @author GW
* @date 2024-02-21
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@AutoMappers({@AutoMapper(target = EnterpriseMaterialFilesTreeDto.class)})
@TableName("enterprise_material_files_tree")
public class EnterpriseMaterialFilesTree  implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type= IdType.AUTO)
    private Long id;

    private String parentId;

    private String suffix;

    private String realName;

    private String type;

    private String fileStorageId;

    private String storageType;

    private Long fileSize;

    @TableField(fill= FieldFill.INSERT)
    private String createId;

    @TableField(fill= FieldFill.INSERT)
    private String createBy;

    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateId;

    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateBy;

    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

    private String deleteId;

    private String deleteBy;

    private Date deleteTime;

    private String deleteType;

    private Long imgSize;

    private String imgStorageId;

    private Long deptId;

    public void copyFrom(EnterpriseMaterialFilesTree source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }

}
